package com.example.springboot.document;

import java.util.Date;

/**
 * @Description: 构建产品实体
 * @Author wenlinyu
 * @Date: 2021/2/9 16:31
 * @Version 1.0
 */
public class ProductBuilder {

    private static Product product;

    public static ProductBuilder create() {
        product = new Product();
        return new ProductBuilder();
    }

    public ProductBuilder addId(String id) {
        product.setId(id);
        return this;
    }

    public ProductBuilder addProductName(String productName) {
        product.setProductName(productName);
        return this;
    }

    public ProductBuilder addProductDesc(String productDesc) {
        product.setProductDesc(productDesc);
        return this;
    }

    public ProductBuilder addCreateTime(Date createTime) {
        product.setCreateTime(createTime);
        return this;
    }

    public ProductBuilder addUpdateTime(Date updateTime) {
        product.setUpdateTime(updateTime);
        return this;
    }

    public Product builder() {
        return product;
    }
}
